package com.sea.app.module.process.controller.result;

import org.activiti.engine.runtime.ProcessInstance;

import java.util.Date;

/**
 * Created by 31417 on 2017/5/9.
 */
public class ProcessInstanceResult {
    protected String id;
    protected String tenantId = "";
    protected String name;
    protected String description;
    protected String localizedName;
    protected String localizedDescription;
    protected boolean isActive = true;
    protected boolean isEnded = false;
    protected int revision = 1;
    protected String processDefinitionId;
    protected String processDefinitionKey;
    protected String processDefinitionName;
    protected Integer processDefinitionVersion;
    protected String deploymentId;
    protected String activityId;
    protected String businessKey;
    protected String parentId;

    public ProcessInstanceResult(ProcessInstance instance){
        this.id = instance.getId();
        this.activityId = instance.getActivityId();
        this.name = instance.getName();
        this.businessKey = instance.getBusinessKey();
        this.deploymentId = instance.getDeploymentId();
        this.isEnded = instance.isEnded();
        this.isActive = !instance.isSuspended();
        this.localizedDescription = instance.getLocalizedDescription();
        this.localizedName = instance.getLocalizedName();
        this.parentId = instance.getParentId();
        this.tenantId = instance.getTenantId();
        this.processDefinitionId = instance.getProcessDefinitionId();
        this.processDefinitionName = instance.getProcessDefinitionName();
        this.processDefinitionVersion = instance.getProcessDefinitionVersion();
        this.processDefinitionKey = instance.getProcessDefinitionKey();
    }

    public String getId() {
        return id;
    }

    public String getTenantId() {
        return tenantId;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public String getLocalizedName() {
        return localizedName;
    }

    public String getLocalizedDescription() {
        return localizedDescription;
    }

    public boolean isActive() {
        return isActive;
    }

    public boolean isEnded() {
        return isEnded;
    }

    public int getRevision() {
        return revision;
    }

    public String getProcessDefinitionId() {
        return processDefinitionId;
    }

    public String getProcessDefinitionKey() {
        return processDefinitionKey;
    }

    public String getProcessDefinitionName() {
        return processDefinitionName;
    }

    public Integer getProcessDefinitionVersion() {
        return processDefinitionVersion;
    }

    public String getDeploymentId() {
        return deploymentId;
    }

    public String getActivityId() {
        return activityId;
    }


    public String getBusinessKey() {
        return businessKey;
    }

    public String getParentId() {
        return parentId;
    }
}
